<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="/styles/general.css"/>
<link rel="stylesheet" type="text/css" href="/styles/main.css"/>
<link rel="stylesheet" type="text/css" href="/styles/pager.css"/>
<script src="/js/utils.js" type="text/javascript"></script>
<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/js/jquery.jeditable.mini.js" type="text/javascript"></script> 
<script src="/js/jquery.pager.js" type="text/javascript"></script> 
<script src="/popWindows/zDrag.js" type="text/javascript"></script>
<script src="/popWindows/zDialog.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript"> 
var s="";
var t="";
var pCount=1;
var page=1;
jQuery.fn.extend({
	  doAjax: function() {
		if($(this).attr("href").indexOf("delete")>0)
	  	{
			if(!confirm("确定删除吗?"))return false;
		}
		$.ajax({			
	        url: $(this).attr("href"),
	        cache: false,
	        success: function(html){
				PageClick(page);
	        }
	    });
	  }
	});
PageClick = function(pageclickednumber) {
	page = pageclickednumber;
	$.ajax({
        url: "/hosts/indexAjax/page/"+pageclickednumber+"/s/"+s+"/t/"+t+"/",
        cache: false,
        success: function(html){
            $("#divtablelist").html(html);
            $("#pager").pager({ pagenumber: pageclickednumber, pagecount: pCount, buttonClickCallback: PageClick });
            $('.hostseditable').editable('/hosts/modifyAjax/', {
            	indicator : '正在保存...',
            	tooltip   : '点击修改...',
            	onblur    : 'submit' 
            });
            $(".ajaxsubmit").click(
        			function(){
        			$(this).doAjax();
        			return false;
        			});
        }
    });
}
$(document).ready(function() {
	PageClick(1);
	$("#search").click(
			function(){
				s=encodeURIComponent($("#keyword").attr("value"));
				t=encodeURIComponent($("#hosttypeid").attr("value"));
				PageClick(1);
				}
			);
});
</script>
</head>
<body >
<h1>
<span class="action-span"><a href="/hosts/add/">添加主机</a></span>
<span class="action-span1">主机管理</span>
<div style="clear:both"></div>
</h1>
<div class="form-div">
	<img src="/images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
	类型<!--{form select * hosttypeid hosttypeid * hosttypeidsearch 10 $hosttypes}-->
    主机IP <input type="text" name="keyword" id="keyword"/> <input type="button" id="search" value=" 搜索 " />
</div>

<div id='divtablelist'></div>
<div id="pager" style='align:center;' /></div>
<div style="clear:both"></div>
{template 'footer.html'}
</body>
</html>